package com.example.design_patterns.abstract_factory_pattern;

public class test {

    public static void main(String[] args) {
        ShapeFactory shapeFactory = new ShapeFactory();
        //圆形
        Shape shape = shapeFactory.getShape("circle");
        shape.draw();
        //长方形
        shape = shapeFactory.getShape("square");
        shape.draw();
        ColorFactory colorFactory = new ColorFactory();
        //红色
        Color color = colorFactory.getColor("red");
        color.getColor();
        //蓝色
        color = colorFactory.getColor("blue");
        color.getColor();
    }
}
